﻿using System.Collections.Generic;
using System.Data;
using System.Linq;

namespace hCommand
{
    /**
   *┌────────────────────────────────────────────────┐
   *│　描    述：LocSelect                                                    
   *│　作    者：sgj                                              
   *│　版    本：1.0                                              
   *│　创建时间：2021/9/8 16:59:49                        
   *└────────────────────────────────────────────────┘
   **/
    public class SingleLocSelect : LocSelect
    {
  

        public override bool canWork(long meId, long beforeId, List<long> relyTask)
        {
            BaseTask me = PathFacade.getTaskById(meId);
            BaseTask before = PathFacade.getTaskById(beforeId);
            if (me.className == before.className)
            {
                return before.status >= (int)CoreTaskParamStatus.取货完成;
            }
            return false;

        }
        public override CoreWhLoc select<CS>(List<CoreWhLoc> locList, long goodDiff,CS cs)
        {

            int len = locList.Count();
            for (int i = 0; i < len; i++)
            {
                CoreWhLoc shallow = locList[i];
                if (shallow.countStock == 0)
                {
                    return shallow;
                }
            }
            return null;

        }
    }
}
